package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.SalesmanPerformanceStatisticsDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.Optional;

/**
 * 业务员微信小程序-业绩统计相关接口
 *
 * @author 郑小翠
 * @version 2.02.18
 * @date 2022-03-28
 */
@Repository
public interface SalesmanPerformanceStatisticsRepository extends JpaRepository<SalesmanPerformanceStatisticsDO, Long>, JpaSpecificationExecutor<SalesmanPerformanceStatisticsDO> {

    /**
     * 根据业务员Id和统计时间查询
     *
     * @param memberUserId     业务员主键Id
     * @param monthStatistical 月统计时间
     * @return 返回业务员业绩统计信息
     */
    Optional<SalesmanPerformanceStatisticsDO> findByMemberUserIdAndMonthStatistical(Long memberUserId, LocalDate monthStatistical);
}
